package trans.model.base;

import java.io.Serializable;


/**
 * This is an object that contains data related to the sa_state_his table.
 * Do not modify this class because it will be overwritten if the configuration file
 * related to this class is modified.
 *
 * @hibernate.class
 *  table="sa_state_his"
 */

public abstract class BaseSaStateHis  implements Serializable {

	private static final long serialVersionUID = 1L;
	public static String REF = "SaStateHis";
	public static String PROP_CREATE_BY_ID = "createBy_id";
	public static String PROP_STATE_FROM = "StateFrom";
	public static String PROP_CREATE_BY = "CreateBy";
	public static String PROP_CREATE_TIME = "CreateTime";
	public static String PROP_SA_ID = "SaId";
	public static String PROP_ID = "Id";
	public static String PROP_STATE_TO = "StateTo";
	public static String PROP_SA = "Sa";


	// constructors
	public BaseSaStateHis () {
		initialize();
	}

	/**
	 * Constructor for primary key
	 */
	public BaseSaStateHis (java.lang.Integer id) {
		this.setId(id);
		initialize();
	}

	protected void initialize () {}



	private int hashCode = Integer.MIN_VALUE;

	// primary key
	private java.lang.Integer id;

	// fields
	private java.util.Date createTime;
	private java.lang.Integer stateFrom;
	private java.lang.Integer stateTo;
	private java.lang.Integer saId;
	private java.lang.Integer createBy_id;
	private String relativeStation;
	private String relativeFlightNo;

	// many to one
	private trans.model.Sa sa;
	private trans.model.User createBy;



	/**
	 * Return the unique identifier of this class
     * @hibernate.id
     *  generator-class="native"
     *  column="id"
     */
	public java.lang.Integer getId () {
		return id;
	}

	/**
	 * Set the unique identifier of this class
	 * @param id the new ID
	 */
	public void setId (java.lang.Integer id) {
		this.id = id;
		this.hashCode = Integer.MIN_VALUE;
	}




	/**
	 * Return the value associated with the column: create_time
	 */
	public java.util.Date getCreateTime () {
		return createTime;
	}

	/**
	 * Set the value related to the column: create_time
	 * @param createTime the create_time value
	 */
	public void setCreateTime (java.util.Date createTime) {
		this.createTime = createTime;
	}



	/**
	 * Return the value associated with the column: state_from
	 */
	public java.lang.Integer getStateFrom () {
		return stateFrom;
	}

	/**
	 * Set the value related to the column: state_from
	 * @param stateFrom the state_from value
	 */
	public void setStateFrom (java.lang.Integer stateFrom) {
		this.stateFrom = stateFrom;
	}



	/**
	 * Return the value associated with the column: state_to
	 */
	public java.lang.Integer getStateTo () {
		return stateTo;
	}

	/**
	 * Set the value related to the column: state_to
	 * @param stateTo the state_to value
	 */
	public void setStateTo (java.lang.Integer stateTo) {
		this.stateTo = stateTo;
	}



	/**
	 * Return the value associated with the column: sa_id
	 */
	public java.lang.Integer getSaId () {
		return saId;
	}

	/**
	 * Set the value related to the column: sa_id
	 * @param saId the sa_id value
	 */
	public void setSaId (java.lang.Integer saId) {
		this.saId = saId;
	}



	/**
	 * Return the value associated with the column: create_by
	 */
	public java.lang.Integer getCreateBy_id () {
		return createBy_id;
	}

	/**
	 * Set the value related to the column: create_by
	 * @param createBy_id the create_by value
	 */
	public void setCreateBy_id (java.lang.Integer createBy_id) {
		this.createBy_id = createBy_id;
	}



	/**
	 * Return the value associated with the column: sa_id
	 */
	public trans.model.Sa getSa () {
		return sa;
	}

	/**
	 * Set the value related to the column: sa_id
	 * @param sa the sa_id value
	 */
	public void setSa (trans.model.Sa sa) {
		this.sa = sa;
	}



	/**
	 * Return the value associated with the column: create_by
	 */
	public trans.model.User getCreateBy () {
		return createBy;
	}

	/**
	 * Set the value related to the column: create_by
	 * @param createBy the create_by value
	 */
	public void setCreateBy (trans.model.User createBy) {
		this.createBy = createBy;
	}
	
	public String getRelativeStation() {
		return relativeStation;
	}

	public void setRelativeStation(String relativeStation) {
		this.relativeStation = relativeStation;
	}
	

	public String getRelativeFlightNo() {
		return relativeFlightNo;
	}

	public void setRelativeFlightNo(String relativeFlightNo) {
		this.relativeFlightNo = relativeFlightNo;
	}

	public boolean equals (Object obj) {
		if (null == obj) return false;
		if (!(obj instanceof trans.model.SaStateHis)) return false;
		else {
			trans.model.SaStateHis saStateHis = (trans.model.SaStateHis) obj;
			if (null == this.getId() || null == saStateHis.getId()) return false;
			else return (this.getId().equals(saStateHis.getId()));
		}
	}

	public int hashCode () {
		if (Integer.MIN_VALUE == this.hashCode) {
			if (null == this.getId()) return super.hashCode();
			else {
				String hashStr = this.getClass().getName() + ":" + this.getId().hashCode();
				this.hashCode = hashStr.hashCode();
			}
		}
		return this.hashCode;
	}


	public String toString () {
		return super.toString();
	}


}